from django.http import JsonResponse
from LogisticsCard.models import CardOrder
from django.views.decorators.http import require_GET

@require_GET
def query_pay_status_api(request):
    order_no = request.GET.get('order_no')
    order = CardOrder.objects.filter(order_no=order_no, status='paid').first()
    return JsonResponse({'is_paid': bool(order)})
